<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org"
      layout:decorator="backstage/layout">
<head>
    <title>球员管理</title>
</head>

<body>
<div id="content" layout:fragment="content">
<script type="text/javascript" src="../../../admin/js/bootstrap-paginator.js"></script>
<script type="text/javascript" src="../../../admin/ace/js/fuelux/fuelux.spinner.min.js"></script>
<script type="text/javascript" src="../../../admin/ace/js/ace-elements.min.js"></script>
<script type="text/javascript" src="../../../admin/js/playerList.js"></script>
    <div class="box-content">
        <div class="row-fluid sortable">
            <div class="box span12">
                <h3 class="row-fluid header smaller lighter blue">
                   <span class="label label-large label-pink arrowed-right">球员管理</span>
                </h3>   
                <h3 class="row-fluid header smaller lighter blue">
                    <a href="#" class="btn btn-small btn-success btn-setting" data-toggle="modal" data-target="#myModal"><i class="icon-user"></i>添加球员</a>
                </h3>
                
                 <form action="/player/palyerList.htm" method="post" id="searchForm">
			            <input type="hidden"  id="page" name="page" th:value="${page.page}" />
		            <input type="hidden"  name="totalPage" th:value="${page.totalPage}" />
		            <input type="hidden" id="name" th:value="${page.filter[name]}" />
		            
		            <span class="topword">球员名称：</span>
		                <input type="text" class="input-xlarge focused" name="name" th:value="${page.filter[name]}"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		            <span class="topword" th:if="${roleId != 2}">所属球队：</span>
		            			<select name="teamId" th:if="${roleId != 2}" >
		            			    <option value=" ">请选择</option>
		            			    <option th:each="team:${teamList}" th:selected="${team.id == player.teamId}"  th:value="${team.id}" th:text="${team.name}"></option>
		            			    
		            			</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		            <input type="submit" class="btn btn-info btn-inverse" value="搜索"/>				
		            
			           
                 </form>
                <div class="box-content">
                    <table class="table table-striped table-bordered bootstrap-datatable datatable">
                        <thead>
                        <tr >
                            <th style="text-align: center;">序号</th>
                            <th style="text-align: center;">球员名称</th>
                            <th style="text-align: center;">球员角色</th>
                            <th style="text-align: center;">球队位置</th>
                            <th style="text-align: center;">球员号码</th>
                            <th style="text-align: center;">身高</th>
                            <th style="text-align: center;">体重</th>
                            <th style="text-align: center;">所属球队</th>
                            <th style="text-align: center;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr th:each="player:${page.result}">
                            <td th:text="${player.id}" style="text-align: center;"></td>
                            <td th:text="${player.name}" style="text-align: center;"></td>
                            
                           <td  style="text-align: center;">
                              <span th:if="${player.role == 1}">球员</span>
                              <span th:if="${player.role == 2}">教练</span>
                              <span th:if="${player.role == 3}">其他角色</span>
                              <span th:if="${player.role == 4}">经理</span>
                            </td>
                            
                            
                            <td  style="text-align: center;">
                               <span th:if="${player.position==1}">PG</span>
                               <span th:if="${player.position==2}">SG</span>
                               <span th:if="${player.position==3}">PF</span>
                               <span th:if="${player.position==4}">SF</span>
                               <span th:if="${player.position==5}">C</span>
                            </td>
                            <td th:text="${player.playerNo}" style="text-align: center;"></td>
                            <td th:text="${player.stature}" style="text-align: center;"></td>
                            <td th:text="${player.weight}" style="text-align: center;"></td>
                            <td th:text="${player.teamName}" style="text-align: center;"></td>
                            <td style="text-align: center;">
                                <a class="btn btn-small btn-danger" th:id="${player.id}" style="width: 26px;">
                                                                                                             删除 
                                </a>
                                 <a class="btn btn-info btn-small editTeamBT" th:id="${player.id}" style="width: 26px;">
                                                                                                           编辑 
                                </a>
                              <input type="hidden" th:id="'playerName-'+${player.id}" th:value="${player.name}"/>
                              <input type="hidden" th:id="'playerRole-'+${player.id}" th:value="${player.role}"/>
                              <input type="hidden" th:id="'playerPosition-'+${player.id}" th:value="${player.position}"/>
                              <input type="hidden" th:id="'playerNo-'+${player.id}" th:value="${player.playerNo}"/>
                              <input type="hidden" th:id="'playerStature-'+${player.id}" th:value="${player.stature}"/>
                              <input type="hidden" th:id="'playerUrl-'+${player.id}" th:value="${player.url}"/>
                              <input type="hidden" th:id="'teamId-'+${player.id}" th:value="${player.teamId}"/>
                              
                             <input type="hidden" th:id="'weight-'+${player.id}" th:value="${player.weight}"/>
                             <input type="hidden" th:id="'age-'+${player.id}" th:value="${player.age}"/>
                             <input type="hidden" th:id="'description-'+${player.id}" th:value="${player.description}"/>
                              
                             <input type="hidden" th:id="'veteran-'+${player.id}" th:value="${player.veteran}"/>
                             <input type="hidden" th:id="'playerLevel-'+${player.id}" th:value="${player.playerLevel}"/>
                             <input type="hidden" th:id="'invitationCode-'+${player.id}" th:value="${player.invitationCode}"/>
                             <input type="hidden" th:id="'hand-'+${player.id}" th:value="${player.hand}"/>
                             <input type="hidden" th:id="'schoolId-'+${player.id}" th:value="${player.schoolId}"/>
                                
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    
                     <div style="margin-bottom: 0px; margin-left: auto;margin-right: auto">
                        <div id="example" style="margin-bottom:0px"></div>
                     </div>
                </div>
            </div><!--/span-->
        </div><!--/row-->
    </div>
    <div id="myModal" class="modal hide fade in">
        <div class="modal-header">
            <button class="close" data-dismiss="modal" type="button">×</button>
            <h3>添加球员</h3>
        </div>
        <form class="form-horizontal" style="margin: 0" enctype="multipart/form-data" action="/player/addOrUpdatePlayer.json" method="post" id="addPlayer">
            <fieldset>
                <div class="modal-body">
                    <div class="control-group">
                        <label class="control-label">姓名：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="name" />
                        </div>
                    </div>
                    
                    <div class="control-group">
                      <label class="control-label">球队角色：</label>
                      <div class="controls">
                          <select  name="role" id="add-role">
                              <option value="1">球员</option>
                              <option value="2">教练</option>
                              <option value="4">经理</option>
                              <option value="3">其他</option>
                          </select>
                      </div>
                    </div>
                    
                    <div class="control-group" id="hand-show">
                      <label class="control-label">球员擅用手：</label>
                      <div class="controls">
                          <select  name="hand" >
                              <option value="1">左手</option>
                              <option value="2">右手</option>
                              <option value="3">左右手</option>
                          </select>
                      </div>
                    </div>
                    
                    <div class="control-group" id="position-show">
                        <label class="control-label">位置：</label>
                        <div class="controls">
                            <select  name="position" >
                              <option value="1">PG</option>
                              <option value="2">SG</option>
                              <option value="3">PF</option>
                              <option value="4">SF</option>
                              <option value="5">C</option>
                            </select>
                            <!--<input class="input-xlarge focused"  type="text" value="" name="position" />-->
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">身高：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="stature" />
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">体重：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="weight" />
                        </div>
                    </div>
                    
                    
                    
                    <div class="control-group" id="playerNo-hidde">
                        <label class="control-label">球员号码：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="playerNo" />
                        </div>
                    </div>
                    
                    <div class="control-group">
                      <label class="control-label">所属学校：</label>
                      <div class="controls">
                          <select  id="SelSchool" name="schoolId" >
                              <option value="">请选择学校</option>
                              <option th:each="school:${schoolList}"  th:value="${school.id}" th:text="${school.name}"></option>
                          </select>
                      </div>
                    </div>
                    
                    <div class="control-group">
                      <label class="control-label">所属球队：</label>
                      <div class="controls">
                          <select  name="teamId" id="selTeam">
                             <option value="">请选择球队</option>
                             <!--  <option th:each="team:${teamList}"   th:value="${team.id}" th:text="${team.name}"></option> -->
                          </select>
                      </div>
                    </div>
                    
                    
                    <div class="control-group" id="veteran-show">
                      <label class="control-label">球龄 ：</label>
                      <div class="controls">
                          <input class="input-xlarge focused"  type="text"  name="veteran" />
                      </div>
                    </div>
                    
                    <div class="control-group" id="playerLevel-show">
                      <label class="control-label">球员水平：</label>
                      <div class="controls">
                          <select  name="playerLevel" >
                              <option value="1">初级水平</option>
                              <option value="2">班队水平</option>
                              <option value="3">系队水平</option>
                              <option value="4">院队水平</option>
                              <option value="5">校队水平</option>
                              <option value="6">半职业水平</option>
                          </select>
                      </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">年龄：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="age" />
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">职责简介：</label>
                        <div class="controls">
                            <textarea class="input-xlarge focused"    name="description" />
                        </div>
                    </div>
                
	                <div class="control-group">
                        <label class="control-label">球员照片：</label>
                        <div class="controls">
                            <div class="widget-main" style="padding:0px;">
	                        	<input type="file" id="id-input-file-1" name="file" />
		                    </div>
                        </div>
                    </div>
                    
                    <!-- <div class="control-group">
                        <label class="control-label">球员邀请码：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="invitationCode" />
                        </div>
                    </div> -->
                </div>
                
               
                <div class="modal-footer">
                    <input type="submit" class="btn btn-primary" value="保存" />
                    <a href="#" class="btn btn-small" data-dismiss="modal">取消</a>
                </div>
            </fieldset>
        </form>
    </div>
    
    
    <div id="editModel" class="modal hide fade in" style="display: none;">
        <div class="modal-header">
            <button class="close" data-dismiss="modal" type="button">×</button>
            <h3>编辑球员</h3>
        </div>
        <form class="form-horizontal" style="margin: 0" enctype="multipart/form-data" action="/player/addOrUpdatePlayer.json" method="post" id="updatePlayer">
             <input id="edit-id" name="id" type="hidden"/>
            <fieldset>
                <div class="modal-body">
                    <div class="control-group">
                        <label class="control-label">姓名：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="name" id="edit-name"/>
                        </div>
                    </div>
                    
                    <div class="control-group">
                      <label class="control-label">球队角色：</label>
                      <div class="controls">
                          <select  name="role" id="edit-role">
                              <option value="1">球员</option>
                              <option value="2">教练</option>
                              <option value="4">经理</option>
                              <option value="3">其他</option>
                          </select>
                      </div>
                    </div>
                    
                    
                    <div class="control-group" id="edit-hand-hide">
                      <label class="control-label">球员擅用手：</label>
                      <div class="controls">
                          <select  name="hand" id="edit-hand">
                              <option value="1">左手</option>
                              <option value="2">右手</option>
                              <option value="3">左右手</option>
                          </select>
                      </div>
                    </div>
                    
                    
                    
                    <div class="control-group" id="position-show">
                        <label class="control-label">位置：</label>
                        <div class="controls">
                            <select  name="position" id="edit-position">
                              <option value="1">PG</option>
                              <option value="2">SG</option>
                              <option value="3">PF</option>
                              <option value="4">SF</option>
                              <option value="5">C</option>
                            </select>
                           
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">身高：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" id="edit-stature" name="stature" />
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">体重：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" id="edit-weight" name="weight" />
                        </div>
                    </div>
                    
                    <div class="control-group" id="edit-playerNo">
                        <label class="control-label">球员号码：</label>
                        <div class="controls" >
                            <input class="input-xlarge focused"  type="text" value="" id="edit-playerNo2" name="playerNo" />
                        </div>
                    </div>
                    
                    
                    <div class="control-group">
                      <label class="control-label">所属学校：</label>
                      <div class="controls">
                          <select  id="SelSchool2" name="schoolId" >
                              <option value="">请选择学校</option>
                              <option th:each="school:${schoolList}"  th:value="${school.id}" th:text="${school.name}"></option>
                          </select>
                      </div>
                    </div>
                    
                    <div class="control-group">
                      <label class="control-label">所属球队：</label>
                      <div class="controls">
                          <select  name="teamId"  id="edit-teamId">
                              <option value="">请选择</option>
                             <!--  <option th:each="team:${teamList}"   th:value="${team.id}" th:text="${team.name}"></option> -->
                          </select>
                      </div>
                    </div>
                    
                    <div class="control-group" id="edit-veteran-hide">
                      <label class="control-label">球龄：</label>
                      <div class="controls">
                         
                          <input class="input-xlarge focused"  type="text" id="edit-veteran"  name="veteran" />
                      </div>
                    </div>
                    
                    <div class="control-group" id="edit-playerLevel-hide">
                      <label class="control-label">球员水平：</label>
                      <div class="controls">
                          <select  name="playerLevel" id="edit-playerLevel">
                              <option value="1">初级水平</option>
                              <option value="2">班队水平</option>
                              <option value="3">系队水平</option>
                              <option value="4">院队水平</option>
                              <option value="5">校队水平</option>
                              <option value="6">半职业水平</option>
                          </select>
                      </div>
                    </div>
                    
                    
                     <div class="control-group">
                        <label class="control-label">年龄：</label>
                        <div class="controls">
                            <input class="input-xlarge focused"  type="text" value="" name="age" id="edit-age"/>
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">职责简介：</label>
                        <div class="controls">
                            <textarea class="input-xlarge focused"    name="description" id="edit-description"/>
                        </div>
                    </div>
                
                
                
                   <div class="control-group">
	                        <label class="control-label">球员照片：</label>
	                        <div class="controls">
	                            <div class="widget-main">
		                        	<input type="file" id="id-input-file-2" name="file" />
			                    </div>
	                        </div>
	                        <div class="controls">
	                            <div class="widget-main">
		                        	<img src="" id="edit_imgPath" style="height: 120px"/>
			                    </div>
	                        </div>
	               </div>
	               
	               <!-- <div class="control-group">
                        <label class="control-label">球员邀请码：</label>
                        <div class="controls">
                            <input class="input-xlarge focused" id="edit-invitationCode"  type="text" value="" name="invitationCode" />
                        </div>
                    </div> -->
                </div>
                <div class="modal-footer">
                    <input type="submit" class="btn btn-primary" value="保存" />
                    <a href="#" class="btn btn-small" data-dismiss="modal">取消</a>
                </div>
            </fieldset>
        </form>
    </div>
</div>
</body>
</html>
